import React, { Component } from "react";
import { Card, message, Button } from "antd";

export default class Message extends Component {
  render() {
    const success = () => {
      message.success("This is a success message");
    };

    const error = () => {
      message.error("This is an error message");
    };

    const warning = () => {
      message.warning("This is a warning message");
    };
    const info = () => {
      message.info("This is a normal message");
    };

    return (
      <div>
        <Card title="类型提示">
          <Button onClick={success}>Success</Button>
          <Button onClick={error}>Error</Button>
          <Button onClick={warning}>Warning</Button>
        </Card>

        <Card title="基本提示">
          <Button type="primary" onClick={info}>
            Display normal message
          </Button>
        </Card>
      </div>
    );
  }
}
